package com.bytedance.scenedemo.lifecycle;

import com.bytedance.scene.Scene;
import com.bytedance.scene.group.UserVisibleHintGroupScene;
import com.bytedance.scene.ktx.SceneExtensions;
import com.bytedance.scenedemo.ResourceTable;
import com.bytedance.scenedemo.benchmark.BenchmarkSamples;
import com.bytedance.scenedemo.extreme_case.EmptyScene;
import com.bytedance.scenedemo.utility.ColorUtil;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;
import ohos.agp.components.ComponentContainer;
import ohos.agp.components.LayoutScatter;
import ohos.agp.components.ScrollView;
import ohos.agp.components.Text;

public class EmptyScene100 extends UserVisibleHintGroupScene {
    @Override
    public ComponentContainer onCreateView(LayoutScatter scatter, ComponentContainer container, Intent intent) {
        Component layout=scatter.parse(ResourceTable.Layout_empty100scene_layout,container,false);
        Text textHint = (Text) layout.findComponentById(ResourceTable.Id_text_empty_hint);
        Text textName = (Text) layout.findComponentById(ResourceTable.Id_text_name_path);
        ScrollView svMain = (ScrollView) layout.findComponentById(ResourceTable.Id_sv_push_pop_basic_usage_main);
        textHint.setText(EmptyScene.class.getName());
        textName.setText(SceneExtensions.getNavigationScene(this).getStateHistory());
        int value = 0;
        if(getArguments()!=null){
            value= (int) getArguments().getParam("value");
        }
        svMain.setBackground(ColorUtil.getMaterialColor(value));

        return (ComponentContainer)layout;
    }
}
